<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head>
	<title>Meus Dados</title>
	<link rel="stylesheet" href="../../../resources/styles/layout.css" type="text/css"/>
	
</h:head>

<h:body>
	<h:form id="form1">
	<div class="wrapper row1">
	  <header id="header" class="clear">
	    <hgroup>
	      <h1><a href="index.html">Cardápio Mobile</a></h1>
	      <h2>Seu cardápio para o mundo todo </h2>
	    </hgroup>
			<fieldset class="fl_right">
		    	<p:panel style="width:300px;height:50px;right:200px;top:60px;background:#696969;border:1px solid black">  
			    	<h:outputLabel style="font-weight:bold;color:#FFFFE0;" value="Usuário:"/>
					<h:outputLabel style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeUsuario')}"/>  
					<fieldset>		
						<h:outputLabel value="Restaurante:" style="font-weight:bold;color:#FFFFE0;"/>  
						<h:outputLabel style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeFantasia')}"/>
					</fieldset>  
				</p:panel> 
			</fieldset>
			<fieldset>
			<p></p>
			</fieldset>
			
	    <nav class="clear">
	      <ul>
	        <li class="active"><a href="#">Minha Conta</a>
	          <ul>
	            <li><a href="portalCardapioMundo.jsf">Portal Home</a></li>
	            <li><a href="../user/meusDados.jsf">Meus Dados</a></li>
	            <li><a href="portalCardapioMundo.jsf?changeAccess=EEN013550">Trocar Acesso</a></li>
	            <li onclick="PF('dlgSair').show()"><a href="#">Sair</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>
	        
	        <li><a href="#">Acesso</a>
	          <ul>
	            <li><a href="../admin/cadUsuario.jsf">Novo Usuário</a></li>
	            <li><a href="../user/consUsuario.jsf">Consulta Usuários</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>
	        
	        <li><a href="#">Restaurante</a>
	          <ul>
	            <li><a href="#">Novo Restaurante</a></li>
	            <li><a href="#">Restaurantes</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Cardápio</a>
	          <ul>
	            <li><a href="#">Novo Cardápio</a></li>
	            <li><a href="#">Cardápios</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Business Intelligence</a>
	          <ul>
	            <li><a href="#">Avaliações Cardápio</a></li>
	            <li><a href="#">Avaliações Atendimento</a></li>
	            <li><a href="#">Avaliações Infraestrutura</a></li>
	            <li><a href="#">Avaliação Geral</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Pagamento</a>
	          <ul>
	            <li><a href="#">Meus Pagamentos</a></li>
	          </ul>
	        </li>
	        <li><a href="#">Plano</a>
	          <ul>
	            <li><a href="#">Meu Plano</a></li>
	            <li><a href="#">Renovação</a></li>
	            <li><a href="#">Novos Planos</a></li>
	          </ul>
	        </li>
	        
	      </ul>
	    </nav>
	  </header>
	</div>
	
	
	<p:dialog id="dialogSair" header="Opção Logout" modal="true" height="85" width="510" widgetVar="dlgSair" resizable="false" 
	showEffect="fade" hideEffect="fade">  
		<h:panelGrid columns="2" cellpadding="5">  
			<h:outputLabel for="username" value="Deseja desconectar do portal Cardápio Mobile ?" style="font-size:15px"/>
		</h:panelGrid>
				          
		<f:facet name="footer">  
			<p class="fl_left">
			<p:commandButton id="cancelarButton" value="Cancelar" height="50" width="50" onclick="PF(dlgSair).hide();"/>
			</p>
			<p class="fl_right">
				<p:commandButton id="sairButton" value="Sair" height="50" width="50" actionListener="#{acessoMB.logout}"/>
			</p>  
		</f:facet>  
    </p:dialog>

	</h:form> 
	
	    <!-- ########################################################################################## -->

	<div class="wrapper row2">
	    <div id="container" class="clear"> 
	    <div id="homepage"> 
	    	<h:form id="form2">
	    
	    		<p:growl id="messages" showDetail="true"/>  
	    		<p:growl id="growl" showDetail="true"/>
   
   				<p:tabView effect="fade" effectDuration="normal">
   				
   				<p:tab title="Dados Usuário">  
   				  
		  				<p:toolbar>  
	    					<p:toolbarGroup align="left">  
						        <p:commandButton actionListener="#{minhaContaMB.alterarDadosUsuario}" title="Salvar" 
						        icon="ui-icon-disk" validateClient="true" ajax="false" />
						         <p:separator />  
				  				<p:commandButton  title="Alterar" icon="ui-icon-check"
				  				action="#{minhaContaMB.setStatusAlterar(false)}" immediate="true" update="grid1,grid2"/>
						         <p:separator />  
						        <p:commandButton title="Cancelar" icon="ui-icon-cancel" 
				  				action="#{minhaContaMB.setStatusAlterar(true)}" immediate="true" update="grid1,grid2"/>
						         <p:separator />  
					    	</p:toolbarGroup>  
			  			</p:toolbar> 
	  				
	
	  				<h:panelGrid id="grid1" columns="2" cellpadding="10">  
					
						 	<h:outputText for="nome" value="#{msgs.nomeUsuario}"/>
							<p:inputText size="30" value="#{minhaContaMB.userObj.nome}" required="true" disabled="#{minhaContaMB.statusAlterar}">
									<f:validateLength minimum="3" maximum="15" />
							</p:inputText>
					 
							<h:outputText for="sobrenome" value="#{msgs.sobrenomeUsuario}"/>
							<p:inputText id="sobrenome" value="#{minhaContaMB.userObj.sobrenome}" 
							disabled="#{minhaContaMB.statusAlterar}" required="true" label="#{msgs.dSobrenomeUsuario}">  
								<f:validateLength minimum="3" maximum="20" />
							</p:inputText> 
	
	
							<h:outputText for="mail" value="#{msgs.emailUsuario}" />
					        <p:inputText id="mail" value="#{minhaContaMB.userObj.mail}" 
					        disabled="#{minhaContaMB.statusAlterar}" required="true" label="#{msgs.dEmailUsuario}"
					        	validatorMessage="Formato de E-mail invalido">  
								<f:validateRegex pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
							</p:inputText> 
	
							<h:outputText for="cpf" value="#{msgs.CPF}" />
					        <p:inputText id="cpf" value="#{minhaContaMB.userObj.cpf}" 
					        disabled="#{minhaContaMB.statusAlterar}" required="true" label="#{msgs.dCPF}">  
							</p:inputText>
							
							<h:outputText for="status" value="#{msgs.statusCons}" />
							<p:inputText value="Ativo" rendered="#{minhaContaMB.userObj.status == 1}" disabled="true"/>

							<h:outputText for="perfil" value="#{msgs.perfilCons}" />
							<p:inputText value="#{minhaContaMB.acesso.perfil}" disabled="true"/>
					         
	
	  				 </h:panelGrid>
	  			</p:tab>
					
				<p:tab title="Dados Acesso">  

	  				<h:panelGrid id="grid2" columns="2" cellpadding="10">  
					       	
			            		<h:outputText for="usuarioUsuario" value="#{msgs.usernameUsuario}"/>
			            		<p:inputText id="usuarioUsuario" value="#{minhaContaMB.userObj.username}" required="=true" 
			            		label="#{msgs.dUsernameUsuario}" disabled="#{minhaContaMB.statusAlterar}">  
						        	<f:validateLength minimum="5" maximum="15" />
						        </p:inputText> 
	
			            		<h:outputText for="passwordAcesso" value="#{msgs.senhaUsuario}"/>
			            		<p:password id="passwordAcesso" redisplay="true" feedback="true" required="true" value="#{minhaContaMB.userObj.password}" match="confirmaSenha" 
			            		label="#{msgs.dSenhaUsuario}" disabled="#{minhaContaMB.statusAlterar}">  
						        	<f:validateLength minimum="5" maximum="15" />
						        </p:password> 
	
			              		<h:outputText for="confirmaSenha" value="#{msgs.confirmaSenhaUsuario}"/>
			            		<p:password id="confirmaSenha" redisplay="true" feedback="true" required="true" value="#{minhaContaMB.userObj.password}" 
			            		label="#{msgs.dConfirmaSenhaUsuario}" disabled="#{minhaContaMB.statusAlterar}">  
						        	<f:validateLength minimum="5" maximum="15" />
						        </p:password> 
			        </h:panelGrid>
			     </p:tab>   
           		
				<p:tab title="Dados Permissão Acesso">  
					<h:panelGrid id="grid3" columns="2" cellpadding="10">  
				
						<p:dataList value="#{minhaContaMB.permissaoAcessoL}" var="acessoPermissao" itemType="square">  
		    				#{acessoPermissao}  
						</p:dataList>
					</h:panelGrid> 
     			</p:tab>
  			</p:tabView>  
  			</h:form>
		</div>
	 	</div>
	</div>

	<!-- Copyright -->
	<div class="wrapper row4">
	  <footer id="copyright" class="clear">
	    <p class="fl_left">Copyright 2014 - All Rights Reserved - <a href="#">W7VM</a></p>
	    <p class="fl_right">W7VM <a href="http://www.w7vm.com/" title="Developer Application Mobile">Developer Application Mobile</a></p>
	  </footer>
	</div>
</h:body>
</html>